package packVistas;

import java.awt.BorderLayout;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;

import packLigaDeFutbol.GestorTemporadas;

import com.jgoodies.forms.layout.FormLayout;
import com.jgoodies.forms.layout.ColumnSpec;
import com.jgoodies.forms.layout.RowSpec;
import com.jgoodies.forms.factories.FormFactory;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

public class ConsultarDatos extends JDialog {

	private static final long serialVersionUID = -7982408931495091255L;
	private final JPanel contentPanel = new JPanel();

	public ConsultarDatos() {
		setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
		setModal(true);
		setResizable(false);
		setTitle("Consultar datos de la liga");
		setBounds(100, 100, 236, 220);
		getContentPane().setLayout(new BorderLayout());
		contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
		getContentPane().add(contentPanel, BorderLayout.CENTER);
		contentPanel.setLayout(new FormLayout(new ColumnSpec[] {
				ColumnSpec.decode("default:grow"),},
			new RowSpec[] {
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				RowSpec.decode("default:grow"),
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,}));
		{
			JButton btnClasificacion = new JButton("Obtener Clasificaci\u00F3n");
			btnClasificacion.addMouseListener(new MouseAdapter() {
				@Override
				public void mouseClicked(MouseEvent e) {
					Clasificacion cl = new Clasificacion();
					cl.setVisible(true);
				}
			});
			contentPanel.add(btnClasificacion, "1, 1");
		}
		{
			JButton btnFairplay = new JButton("Premio Fairplay");
			btnFairplay.addMouseListener(new MouseAdapter() {
				@Override
				public void mouseClicked(MouseEvent arg0) {
					FairPlay fp = new FairPlay();
					fp.setVisible(true);
				}
			});
			contentPanel.add(btnFairplay, "1, 3");
		}
		{
			JButton btnConsultarEstadisticas = new JButton("Consultar estad\u00EDsticas");
			btnConsultarEstadisticas.addMouseListener(new MouseAdapter() {
				@Override
				public void mouseClicked(MouseEvent arg0) {
					new SeleccionTemporada(new Estadisticas());
				}
			});
			contentPanel.add(btnConsultarEstadisticas, "1, 5");
		}
		{
			JButton btnConsultarPartido = new JButton("Consultar partido");
			btnConsultarPartido.addMouseListener(new MouseAdapter() {
				@Override
				public void mouseClicked(MouseEvent arg0) {
					new SeleccionTemporada(new ConsultarPartido());
				}
			});
			contentPanel.add(btnConsultarPartido, "1, 7");
		}
		{
			JButton btnCerrar = new JButton("Cerrar");
			btnCerrar.addMouseListener(new MouseAdapter() {
				@Override
				public void mouseClicked(MouseEvent e) {
					dispose();
				}
			});
			contentPanel.add(btnCerrar, "1, 11");
		}
	}

}
